Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

keccak

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keccak

Keccak sponge function family

  • 2.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created

What is keccak?

The keccak npm package provides an implementation of the Keccak cryptographic hash function, which is the basis for the SHA-3 (Secure Hash Algorithm 3) standard. It allows developers to generate hash digests of data, which can be used for data integrity verification, digital signatures, and other cryptographic applications.

What are keccak's main functionalities?

Hashing a string

This feature allows you to hash a string using the Keccak-256 algorithm. The code sample demonstrates how to hash the string 'hello world' and output the resulting hash in hexadecimal format.

const keccak = require('keccak');
const hash = keccak('keccak256').update('hello world').digest('hex');
console.log(hash);

Hashing a buffer

This feature allows you to hash a buffer using the Keccak-256 algorithm. The code sample demonstrates how to hash a buffer containing the string 'hello world' and output the resulting hash in hexadecimal format.

const keccak = require('keccak');
const buffer = Buffer.from('hello world');
const hash = keccak('keccak256').update(buffer).digest('hex');
console.log(hash);

Hashing with different Keccak variants

This feature allows you to use different variants of the Keccak algorithm, such as Keccak-256 and Keccak-512. The code sample demonstrates how to hash the string 'hello world' using both Keccak-256 and Keccak-512, and output the resulting hashes in hexadecimal format.

const keccak = require('keccak');
const hash256 = keccak('keccak256').update('hello world').digest('hex');
const hash512 = keccak('keccak512').update('hello world').digest('hex');
console.log('Keccak-256:', hash256);
console.log('Keccak-512:', hash512);

Other packages similar to keccak

Keywords

FAQs

Package last updated on 01 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc